﻿using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WPS.SDK.model.yunfile
{
    /// <summary>
    /// 创建文件类
    /// </summary>
    public class CreateFile
    {
        public string fileid;
        public string fname;
        public long result;
        public static CreateFile fromJsonObject(JObject jsonObject)
        {
            CreateFile createFile = new CreateFile();
            JObject fileInfoObject = JsonConvert.DeserializeObject<JObject>(jsonObject["file"].ToString());
            if (fileInfoObject == null)
            {
                return createFile;
            }
            createFile.fileid = fileInfoObject["open_fileid"].ToString();
            createFile.fname = fileInfoObject["file_name"].ToString();
            createFile.result = Convert.ToInt64(jsonObject["result"]);
            return createFile;
        }
    }
}
